﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

namespace Core.CMS
{
    public class ManagedPage : Page
    {
        public PageInfo Info
        {
            get
            {
                try
                {
                    if (Page.RouteData.Values["PageID"] != null)
                        return PageInfo.Get(int.Parse(Page.RouteData.Values["PageID"].ToString()));
                    else if (Request.QueryString["PageID"] != null)
                        return PageInfo.Get(int.Parse(Request.QueryString["PageID"]));

                    if (PageInfo.HomePage != null)
                        return PageInfo.HomePage;

                    return new PageInfo();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
    }
}
